<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

<html lang="en">
<head>

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

<meta name="generator" content="PHPDoctor 2RC4 (http://peej.github.com/phpdoctor/)">
<meta name="when" content="Fri, 10 Jun 2011 12:14:36 +0000">

<link rel="stylesheet" type="text/css" href="../stylesheet.css">
<link rel="start" href="../overview-summary.html">

<title>TrackMania_WebServices (API Documentation &bull; TrackMania Web Services SDK for PHP)</title>

</head>
<body id="definition" onload="parent.document.title=document.title;">

<div class="header">
<h1>TrackMania Web Services SDK for PHP</h1>
<ul>
<li><a href="../overview-summary.html">Overview</a></li>
<li><a href="../trackmania/package-summary.html">Namespace</a></li>
<li class="active">Class</li>
<li><a href="../trackmania/package-tree.html">Tree</a></li>
<li><a href="../deprecated-list.html">Deprecated</a></li>
<li><a href="../todo-list.html">Todo</a></li>
<li><a href="../index-all.html">Index</a></li>
</ul>
</div>

<div class="small_links">
<a href="../index.html" target="_top">Frames</a>
<a href="../trackmania\trackmania_webservices.html" target="_top">No frames</a>
</div>
<div class="small_links">
Summary: <a href="#summary_field">Field</a> | <a href="#summary_method">Method</a> | <a href="#summary_constr">Constr</a>
Detail: <a href="#detail_field">Field</a> | <a href="#detail_method">Method</a> | <a href="#summary_constr">Constr</a>
</div>
<hr>

<div class="qualifiedName">TrackMania\TrackMania_WebServices</div>
<div class="location">trackmania-ws.php at line 586</div>
<h1>Class TrackMania_WebServices</h1>

<pre class="tree"><strong>TrackMania_WebServices</strong><br /></pre>

<hr>

<p class="signature">public abstract  class <strong>TrackMania_WebServices</strong></p>

<div class="comment" id="overview_description"><p>REST client used to execute HTTP requests on the TrackMania Web Services API.
Service classes of the SDK extends this base class.</p></div>

<hr>

<table id="summary_field">
<tr><th colspan="2">Constant Summary</th></tr>
<tr>
<td class="type">final static  str</td>
<td class="description"><p class="name"><a href="#VERSION">VERSION</a></p></td>
</tr>
</table>

<table id="summary_field">
<tr><th colspan="2">Field Summary</th></tr>
<tr>
<td class="type"> <a href="../trackmania/trackmania_exception.html">TrackMania_Exception</a></td>
<td class="description"><p class="name"><a href="#lastException">$lastException</a></p><p class="description">Last exception if throwExceptions is set to false</p></td>
</tr>
</table>

<table id="summary_method">
<tr><th colspan="2">Method Summary</th></tr>
<tr>
<td class="type"> void</td>
<td class="description"><p class="name"><a href="#__construct()">__construct</a>(string username, string password)</p><p class="description">Default constructor. </p></td>
</tr>
<tr>
<td class="type">protected  mixed</td>
<td class="description"><p class="name"><a href="#execute()">execute</a>(string method, string ressource, array params)</p><p class="description">Executes a HTTP request on the API.
</p></td>
</tr>
</table>

<h2 id="detail_field">Constant Detail</h2>
<div class="location">trackmania-ws.php at line 588</div>
<h3 id="VERSION">VERSION</h3>
<code class="signature">public final static  str <strong>VERSION</strong> = '0.7'</code>
<div class="details">
</div>

<hr>

<h2 id="detail_field">Field Detail</h2>
<div class="location">trackmania-ws.php at line 620</div>
<h3 id="lastException">lastException</h3>
<code class="signature">public  <a href="../trackmania/trackmania_exception.html">TrackMania_Exception</a> <strong>$lastException</strong></code>
<div class="details">
<p>Last exception if throwExceptions is set to false</p></div>

<hr>

<h2 id="detail_method">Method Detail</h2>
<div class="location">trackmania-ws.php at line 631</div>
<h3 id="__construct()">__construct</h3>
<code class="signature">public  void <strong>__construct</strong>(string username, string password)</code>
<div class="details">
<p>Default constructor. Children classes should, if they need to override it,
keep the same first two parameters (the API credentials) to keep the usage of the SDK simple.</p><p>You can manage your API credentials at http://developers.trackmania.com</p><dl>
<dt>Parameters:</dt>
<dd>username - API username</dd>
<dd>password - API password</dd>
</dl>
</div>

<hr>

<div class="location">trackmania-ws.php at line 671</div>
<h3 id="execute()">execute</h3>
<code class="signature">protected  mixed <strong>execute</strong>(string method, string ressource, array params)</code>
<div class="details">
<p>Executes a HTTP request on the API.</p><p>The usage of the $ressource and $params parameters is similar to the use
of the sprintf() function. You can PUT sprintf() placeholders in the
$ressource, and the first elements of the $params array will be
urlencode'd and sprintf()'ed in the ressource. The last element of the
$params array will be serialized and used for request body if using
POST or PUT methods.</p><p>Examples:
<code>
$obj->execute('GET', '/stuff/%s/', array('foobar')); // => /stuff/foobar/
$obj->execute('GET', '/stuff/%s/', array('foo bar')); // => /stuff/foo%20bar/
$obj->execute('GET', '/stuff/%s/%d/', array('foobar', 1)); // => /stuff/foobar/1/
$obj->execute('POST', '/stuff/', array($someDataToPost)); // => /stuff/
$obj->execute('POST', '/stuff/%s/', array('foobar', $someDataToPost)); // => /stuff/foobar/
</code></p><dl>
<dt>Parameters:</dt>
<dd>method - The HTTP method to use. Only GET, POST, PUT and DELETE are supported for now.</dd>
<dd>ressource - The ressource (path after the URL + query string)</dd>
<dd>params - The parameters</dd>
<dt>Returns:</dt>
<dd>The unserialized API response</dd>
<dt>Throws:</dt>
<dd><a href="../trackmania/trackmania_exception.html">TrackMania_Exception</a></dd>
</dl>
</div>

<hr>

<div class="header">
<h1>TrackMania Web Services SDK for PHP</h1>
<ul>
<li><a href="../overview-summary.html">Overview</a></li>
<li><a href="../trackmania/package-summary.html">Namespace</a></li>
<li class="active">Class</li>
<li><a href="../trackmania/package-tree.html">Tree</a></li>
<li><a href="../deprecated-list.html">Deprecated</a></li>
<li><a href="../todo-list.html">Todo</a></li>
<li><a href="../index-all.html">Index</a></li>
</ul>
</div>

<div class="small_links">
<a href="../index.html" target="_top">Frames</a>
<a href="../trackmania\trackmania_webservices.html" target="_top">No frames</a>
</div>
<div class="small_links">
Summary: <a href="#summary_field">Field</a> | <a href="#summary_method">Method</a> | <a href="#summary_constr">Constr</a>
Detail: <a href="#detail_field">Field</a> | <a href="#detail_method">Method</a> | <a href="#summary_constr">Constr</a>
</div>
<hr>

<p id="footer">This document was generated by <a href="http://peej.github.com/phpdoctor/">PHPDoctor: The PHP Documentation Creator</a></p>

</body>

</html>